import request from '@/utils/request'

// 查询电台列表
export function listStation(query) {
  return request({
    url: '/business/station/list',
    method: 'get',
    params: query
  })
}

// 查询电台详细
export function getStation(radioStationId) {
  return request({
    url: '/business/station/' + radioStationId,
    method: 'get'
  })
}

// 新增电台
export function addStation(data) {
  return request({
    url: '/business/station',
    method: 'post',
    data: data
  })
}

// 修改电台
export function updateStation(data) {
  return request({
    url: '/business/station',
    method: 'put',
    data: data
  })
}

// 删除电台
export function delStation(radioStationId) {
  return request({
    url: '/business/station/' + radioStationId,
    method: 'delete'
  })
}



// 获取电台集合
export function getStationlistAll(locatedAddress ) {
  let url = '/business/station/listAll';
  if(locatedAddress){
      url = '/business/station/listAll?locatedAddress=' + locatedAddress
  }
  return request({
    url: url,
    method: 'get'
  })
}